import java.util.*;
public class Test {
    public static void main1(String[] args) {
        int[] a = new int[2];
        System.out.println(a[0]);
    }

    public static void main2(String[] args){
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int score = 0;
        //密码长度
        int len = str.length();
        if(len >= 8){
            score += 25;
        }else if(len <= 4){
            score += 5;
        }else{
            score += 10;
        }

        int[] alph = new int[2];
        int[] digit = new int[2];
        int[] spesym = new int[2];

        for(int i = 0; i < str.length(); i++){
            char ch = str.charAt(i);
            if(alph[0] == 0 && (ch >= 'a' && ch <= 'z')){
                alph[0]++;
            }
            if(alph[1] == 0 && (ch >= 'A' && ch <= 'Z')){
                alph[1]++;
            }
            if(digit[0] == 0 && (ch >= '0' && ch <= '9')){
                digit[0]++;
            }
            if(digit[1] == 0 && (ch >= '0' && ch <= '9')){
                digit[1]++;
            }
            if(spesym[0] == 0 && ((ch >= ' ' && ch <= '/') || (ch >= ':' && ch <= '`') || (ch >= '{' && ch <= '~'))){
                spesym[0]++;
            }
            if(spesym[1] == 0 && ((ch >= ' ' && ch <= '/') || (ch >= ':' && ch <= '`') || (ch >= '{' && ch <= '~'))){
                spesym[1]++;
            }
        }

        if(alph[0] + alph[1] == 2){
            score += 20;
        }else if(alph[0] + alph[1] == 1){
            score += 10;
        }else{
            score += 0;
        }

        if(digit[0] + digit[1] == 2){
            score += 20;
        }else if(digit[0] + digit[1] == 1){
            score += 10;
        }else{
            score += 0;
        }

        if(spesym[0] + spesym[1] == 2){
            score += 20;
        }else if(spesym[0] + spesym[1] == 1){
            score += 10;
        }else{
            score += 0;
        }

        if(alph[0] + alph[1] == 2 && digit[0] + digit[1] >= 1 && spesym[0] + spesym[1] >= 1){
            score += 5;
        }else if(alph[0] + alph[1] >= 1 && digit[0] + digit[1] >= 1 && spesym[0] + spesym[1] >= 1){
            score += 3;
        }else if(alph[0] + alph[1] >= 1 && digit[0] + digit[1] >= 1){
            score += 2;
        }

        if(score >= 90){
            System.out.print("VERY_SECURE");
        }else if(score >= 80){
            System.out.print("SECURE");
        }else if(score >= 70){
            System.out.print("VERY_STRONG");
        }else if(score >= 60){
            System.out.print("STRONG");
        }else if(score >= 50){
            System.out.print("AVERAGE");
        }else if(score >= 25){
            System.out.print("WEEK");
        }else{
            System.out.print("VERY_WEEK");
        }
    }

    public static void main3(String[] args){
        Scanner sc = new Scanner(System.in);

            int n = sc.nextInt();
            int count = 0;
            int max = 0;
            for(int i = 0; i < 32; i++){
                if((n & 1) == 1){
                    count++;
                }else{
                    if(count > max){
                        max = count;

                    }
                    count = 0;
                }
                n = n >> 1;
            }
            System.out.print(max);
        }

    public static int getLCA(int a, int b) {
        if(a == b){
            return a;
        }
        Deque<Integer> queue1 = new LinkedList<>();
        Deque<Integer> queue2 = new LinkedList<>();

        while(a >= 1){
            queue1.add(a);
            a /= 2;
        }

        while(b >= 1){
            queue2.add(b);
            b /= 2;
        }

        int size = queue1.size() - queue2.size();

        if(size > 0){
            while(size > 0){
                queue1.poll();
                size--;
            }
        }else{
            size = -size;
            while(size > 0){
                queue2.poll();
                size--;
            }
        }

        while(queue1.peek() != queue2.peek()){
            queue1.poll();
            queue2.poll();
        }

        return queue1.poll();

    }

    public static void main(String[] args) {
        System.out.println(getLCA(7,15));
    }
}

